Skip to content

fix: repair cross-package bugs so tests and typecheck pass#40

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2472-1781493741
Open

fix: repair cross-package bugs so tests and typecheck pass#40
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2472-1781493741

Conversation

@stooit

@stooit stooit commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and type errors in the monorepo. The suite now reports 13 pass / 0 fail and tsc --noEmit exits cleanly (0 errors).

Four cross-package bugs (plus a type-config gap) were fixed:

  • Renamed hook reconciledpackages/utils now exports useSearchDebounce (re-export of useDebounce), and apps/web/src/lib/api.ts imports useSearchDebounce instead of the stale useThrottle. This resolved both the failing api module tests and the TS2305 type error.
  • Button accessibility — the icon-only Button (packages/ui) now forwards aria-label so it has an accessible name; when no label is provided it no longer emits an empty aria-label="".
  • Date formattingpackages/utils/src/format/date.ts corrected to produce en-AU day/month order with a non-zero-padded day (e.g. 1/03/2024, not 01/03/2024).
  • bun:test type resolution — added the already-installed bun-types package to compilerOptions.types in tsconfig.json so test files type-check. No new dependency was added (the package was already present in node_modules).

The DataTable controlled re-render (stale-closure) test was verified to pass; no change was required there.

Verification

```
bun test packages/utils/test packages/ui/test apps/web/test --preload ./packages/ui/test/setup.ts

13 pass, 0 fail

./node_modules/.bin/tsc --noEmit

exit 0

```

Assumptions / constraints honoured

  • No test files modified and no new dependencies added, per task constraints.
  • Treated the canonical test invocation as the repo's `npm test` script (which includes `--preload ./packages/ui/test/setup.ts` to register happy-dom). Running bare `bun test` without that preload yields spurious `document is not defined` failures; those are an invocation artefact, not source bugs.
  • `bun-types` was already resolvable in `node_modules` (v1.3.14), so registering it in `tsconfig` is a config change, not a dependency addition.
  • For icon-only buttons with no `aria-label`, kept a sensible fallback accessible name rather than rendering an empty string (WCAG 4.1.2).

Files changed

  • `apps/web/src/lib/api.ts`
  • `packages/ui/src/components/Button/Button.tsx`
  • `packages/utils/src/format/date.ts`
  • `packages/utils/src/index.ts`
  • `tsconfig.json`

- utils: re-export useDebounce as useSearchDebounce to match consumer + tests
- web: import useSearchDebounce from @e2e/utils (was stale useThrottle)
- ui: forward aria-label on icon-only Button for accessible name
- utils: fix formatDate to en-AU non-zero-padded day/month order
- tsconfig: register already-installed bun-types to resolve bun:test types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant